
<%@page import="cn.egame.interfaces.pu.AppParameter"%>
<%@page import="com.egame.manage.biz.server.ManageClient"%>
<%@page import="com.egame.manage.biz.domain.AuditInfo"%>
<%@page import="cn.egame.interfaces.gc.GameChargeInfo"%>
<%@page import="com.egame.manage.biz.utils.ConstVar"%>
<%@page import="com.egame.manage.biz.server.pu.ParameterServiceImpl"%>
<%@page import="com.egame.manage.biz.server.gc.GameServiceImpl"%>
<%@page import="com.egame.manage.biz.server.ManageClientExt"%>
<%@page import="com.egame.manage.biz.domain.ImageInfo"%>
<%@page import="com.egame.manage.biz.server.UserServiceImpl"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="cn.egame.interfaces.gc.GameInfo"%> 
<%@page import="java.util.*"%> 
<%@page import="cn.egame.interfaces.cp.ContentProviderInfo"%> 
<%@page import="cn.egame.interfaces.EnumType.*"%> 
<%@page import="com.lenovo.manager.business.domain.UserBean"%>
<%@page import="com.egame.manage.biz.utils.ConstVar"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/main.css"  />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.9.1.js"></script>
<script type="text/javascript">

	$(document).ready(function() {
		$(".matter_box table.productDet").show();
		$(".matter_box table.auditInfo").hide();
		$(".matter_box table.consumerInfo").hide();
		$(".matter_box table.gamePicture").hide();
		$(".matter_box table.historyInfo").hide();
		
		$(".matter_box h3.proDetail").click(function(){
		 	 $(".matter_box table.productDet").slideToggle("fast");
		});
		
		$(".matter_box h3.audInfo").click(function(){
		 	 $(".matter_box table.auditInfo").slideToggle("fast");
		});
		
		$(".matter_box h3.consuInfo").click(function(){
		 	 $(".matter_box table.consumerInfo").slideToggle("fast");
		});
		
		$(".matter_box h3.gamePic").click(function(){
		 	 $(".matter_box table.gamePicture").slideToggle("fast");
		});
		
		$(".matter_box h3.hisInfo").click(function(){
		 	 $(".matter_box table.historyInfo").slideToggle("fast");
		});
		
		if($("td.tclCode").text()==null){
			$("td.tclCode").html("");
		}
	});
</script>
<title>产品信息</title>
</head>
<body>
<%
	GameInfo bean = new GameInfo();
	if(request.getAttribute("bean")!=null){
		bean = (GameInfo)request.getAttribute("bean");
	}
%>
<div id="scrollPic" style="height: 1100px;overflow: scroll;">
<div class="matter_box">
	<h3 class="nopoint proDetail"><strong>产品详情</strong></h3>
	<table class="table2 productDet">	
		<tr>
			<td>产品编号</td>
			<td><%=bean.getGId() %> </td>
			<td>创建时间</td>
			<td>
			<% 	
				String productInsertTime = "";
				if(bean.getInsertTime() != null && bean.getInsertTime().getTime()>0){
					productInsertTime = cn.egame.common.util.Utils.toDateString(bean.getInsertTime(),"yyyy-MM-dd hh:mm:ss");
				}				
			%>
				<%=productInsertTime %>
			</td>
		</tr>
		<tr>
			<td>产品状态</td>
			<td><%=bean.getGameStatus()==null?"":(bean.getGameStatus()).getMessage() %></td>
			<td>发布时间</td>
			<td>
			<% 	
				String publishTime = "";
				if(bean.getPublishTime() != null && bean.getPublishTime().getTime()>0){
					publishTime = cn.egame.common.util.Utils.toDateString(bean.getPublishTime(),"yyyy-MM-dd hh:mm:ss");
				}				
			%>
				<%=publishTime %>
			</td>
		</tr>
		<tr>
			<td>首次商用时间</td>
			<td>	
			<% 	
				String firstOnlineTime = "";
				if(bean.getFirstOnlineTime()>0){
					firstOnlineTime = cn.egame.common.util.Utils.toDateString(bean.getFirstOnlineTime(),"yyyy-MM-dd hh:mm:ss");
				}				
			%>	
				<%=firstOnlineTime %>
			</td>
			<td>最后一次商用时间</td>
			<td>
			<% 	
				String lastOnlineTime = "";
				if(bean.getLastOnlineTime() != null && bean.getLastOnlineTime().getTime()>0){
					lastOnlineTime = cn.egame.common.util.Utils.toDateString(bean.getLastOnlineTime(),"yyyy-MM-dd hh:mm:ss");
				}				
			%>
				<%=lastOnlineTime %>
			</td>
		</tr>
		<tr>
			<td>最后一次下线时间</td>
			<td>
			<% 	
				String lastOfflineTime = "";
				if(bean.getLastOfflineTime() != null && bean.getLastOfflineTime().getTime()>0){
					lastOfflineTime = cn.egame.common.util.Utils.toDateString(bean.getLastOfflineTime(),"yyyy-MM-dd hh:mm:ss");
				}				
			%>
				<%=lastOfflineTime %>
			</td>
			<td>最后更新时间</td>
			<td>
			<% 	
				String updateTime = "";
				if(bean.getUpdateTime() != null && bean.getUpdateTime().getTime()>0){
					updateTime = cn.egame.common.util.Utils.toDateString(bean.getUpdateTime(),"yyyy-MM-dd hh:mm:ss");
				}			
			%>
				<%=updateTime %>
			</td>
		</tr>		
	</table>
</div>
<div class="matter_box">
	<h3 class="nopoint audInfo"><strong>审核信息</strong></h3>
	<table class="table2 auditInfo">
		<tr>
			<td class="name">产品类别</td>
			<td>TV产品</td>
			<td>创建时间</td>
			<td>
			<% 	
				String insertTime = "";
				if(bean.getInsertTime() != null && bean.getInsertTime().getTime()>0){
					insertTime = cn.egame.common.util.Utils.toDateString(bean.getInsertTime(),"yyyy-MM-dd hh:mm:ss");
				}			
			%>
				<%=insertTime %>
			</td>
		</tr>
		<tr>
			<td  class="name">厂商简称</td>
			<td><%=GameServiceImpl.getInstance().getContentProviderInfoById(0, 0L, bean.getCpId()).getShortName() %></td>
			<td>合作方代码</td>
			<td><%=GameServiceImpl.getInstance().getContentProviderInfoById(0, 0L, bean.getCpId()).getCPCode() %></td>
		</tr>
		<tr>
			<td class="name">产品名称</td>
			<td><%=bean.getGameName() %></td>
			<td>产品类型</td>
			<td><%=bean.getNetworkType()==null?"":bean.getNetworkType().getMessage() %></td>
		</tr>
		<tr>
			<td class="name">产品代码</td>
			<td><%=bean.getGameCode() %></td>
			<td>渠道代码</td>
			<td></td>
		</tr>
		<tr>
			<td class="name">产品分类</td>
			<td>
			<%
				AppParameter productApp = GameServiceImpl.getInstance().getAppParameterByGId(0, 0L, bean.getGId());
				if(productApp==null)productApp = new AppParameter();
			%>
			<%=productApp.getName() %></td>
			<td>产品子类</td>
			<td><%=ParameterServiceImpl.getInstance().getParameterNameById(0,0L,ConstVar.APP_OS,""+bean.getOsCode()) %></td>
		</tr>
		<tr>
			<td class="name">支付类型</td>
			<td><%=PayType.lookup(bean.getPayCode())==null?"":PayType.lookup(bean.getPayCode()).getMessage() %></td>
			<td>计费类型</td>
			<td><%=FeeType.lookup(bean.getFeeCode())==null?"":FeeType.lookup(bean.getFeeCode()).getMessage() %></td>
		</tr>
		<tr>
			<td class="name">版权有效日期</td>
			<td>
			<% 	
				String effectiveTime = "";
				if(bean.getEffectiveTime() != null && bean.getEffectiveTime().getTime()>0){
					effectiveTime = cn.egame.common.util.Utils.toDateString(bean.getEffectiveTime(),"yyyy-MM-dd hh:mm:ss");
				}			
			%>
				<%=effectiveTime %>
			</td>
			<td>TCL应用编号</td>
			<td class="tclCode"><%=bean.getTclAppId() %></td>
		</tr>
		<tr>
			<td class="name">游戏介绍</td>
			<td colspan=3><%=bean.getIntroduction() %></td>
		</tr>
		<tr>
			<td class="name">游戏攻略</td>
			<td colspan=3>
			<% 
				String[] stratery = {"",""};
				if(request.getAttribute("stratery")!=null){
					stratery = (String[])request.getAttribute("stratery");
				}		
			%>
				<a href="<%=stratery[1] %>"><%=stratery[0] %></a>
			</td>
		</tr>
		<tr>
			<td class="name">游戏Demo</td>
			<td colspan=3>
			<% 
				String[] demo = {"",""};
				if(request.getAttribute("demo")!=null){
					demo = (String[])request.getAttribute("demo");
				}		
			%>
				<a href="<%=demo[1] %>"><%=demo[0] %></a>
			</td>
		</tr>
		<tr>
			<td class="name">版权证明</td>
			<td colspan=3>
			<% 
				String[] copyright = {"",""};
				if(request.getAttribute("copyright")!=null){
					copyright = (String[])request.getAttribute("copyright");
				}		
			%>
				<a href="<%=copyright[1] %>"><%=copyright[0] %></a>
			</td>
		</tr>
		<tr>
			<td class="name">操作方式</td>
			<td colspan=3>
			<% if(bean.getIsRemoteControl()==1){ %>支持遥控器<%} %>
			<% if(bean.getIsHandle()==1){ %>支持手柄<%} %>
			<% if(bean.getIsSense()==1){ %>支持体感<%} %>
			<% if(bean.getIsKeyboard()==1){ %>支持键盘<%} %>
			<% if(bean.getIsMouse()==1){ %>支持飞鼠<%} %>
			</td>
		</tr>
	</table>
</div>
<div class="matter_box">
	<h3 class="nopoint consuInfo"><strong>消费信息</strong></h3>
	<table class="table2 consumerInfo">
		<tr class="gamePicInfo">
			<td>
				<table>
				<%
					List<GameChargeInfo> charges = new ArrayList<GameChargeInfo>();
					if(request.getAttribute("charges")!=null){
						charges = (List<GameChargeInfo>)request.getAttribute("charges");
						if(charges!=null && charges.size()>0){
							%>
						<tr>
							<td>道具编号</td>
							<td>道具名称</td>
							<td>功能</td>
							<td>触发条件</td>
							<td>购买指南</td>			
							<td>价格(单位：分)</td>
							<td>消费类型</td>
						</tr>
							<%
							for(GameChargeInfo charge:charges){
								%>
						<tr>
							<td><%=charge.getChargeId() %> </td>
							<td><%=charge.getChargeName() %> </td>
							<td><%=charge.getFunction() %> </td>
							<td><%=charge.getTrigerCondition() %> </td>
							<td><%=charge.getBugGuide() %> </td>
							<td><%=charge.getPrice() %> </td>
							<td>					
							<% 
								String type = "";
								if(charge.getChargeType()==0){
									type = "软计费点";
								}else if(charge.getChargeType()==1){
									type = "硬计费点";
								}else if(charge.getChargeType()==2){
									type = "联网计费点";
								}
							%>		
								<%=type %> 
							</td>
						</tr>
								<%
							}
						}
					}
				%>
				</table>
			</td>
		</tr>
	</table>
</div>
<div class="matter_box">
	<h3 class="nopoint gamePic"><strong>游戏图片</strong></h3>
		<table class="table2 gamePicture">
			<tr class="gamePicInfo">
				<td>
					<table>
					<% 
						List<ImageInfo> images = new ArrayList<ImageInfo>();
						if(request.getAttribute("images")!=null){
							images = (List<ImageInfo>)request.getAttribute("images");
						}
						if(images!=null && images.size()>0){
							%>		
							<tr>
								<th>图片</th>
								<th>图片类型</th>
								<th>图片尺寸</th>
								<th>大小</th>
								<th>使用说明</th>
							</tr>			
							<%
							for(ImageInfo image:images){
								%>
							<tr>
								<td>				
									<img alt="" src="<%=image.getPath() %>" width="200" height="120">
									<a href="<%=request.getContextPath() + "/caidan/game/image/download.do?path=" + image.getPath() + "&name=" + image.getName() + "&gid=" + bean.getGId() + "&id=" + image.getId() %>"><%=image.getName() %></a>
								</td>
								<td><%=image.getType() %></td>
								<td><%=image.getWidth() %>×<%=image.getHeight() %></td>
								<td><%=image.getSize() %></td>
								<td><%=image.getRemark() %></td>
							</tr>
								<%
							}
						}
						
					%>
					</table>
				</td>
			</tr>
		</table>
</div>
<div class="matter_box">
	<h3 class="nopoint hisInfo"><strong>历史信息</strong></h3>
	<table class="table2 historyInfo">
		<%
			List<AuditInfo> audits = new ArrayList<AuditInfo>();
			if(request.getAttribute("audits")!=null){
				audits = (List<AuditInfo>)request.getAttribute("audits");
			}
			if(audits != null && audits.size()>0){
				%>
		<tr>
			<td>序号</td>
			<td>流程节点</td>
			<td>操作人</td>
			<td>操作时间</td>
		</tr>
				<%
				int i = 1;
				for(AuditInfo audit:audits){					
				%>
		<tr>
			<td><%=i++ %> </td>
			<td><%=GameStatus.lookup(audit.getGameStatus()).getMessage() %> </td>
			<td><%=UserServiceImpl.getInstance().getCnNameById(bean.getOperatrId()) %> </td>
			<td>
			<% 
				String auditTime = "";
				if(audit.getInsertTime()>0){
					auditTime = cn.egame.common.util.Utils.toDateString(audit.getInsertTime(),"yyyy-MM-dd hh:mm:ss");
				}
			%>
				<%=auditTime %>
			</td>
		</tr>
					<%
				}
			}
			
		%>
	</table>
</div>
</div>
</body>
</html>